(function () {

    var
    ns = {
        ajax : bump.$core.namespace('bump.framework.ajax')
    },
    SHIM_ELEMENT = $('<div class="shim"><img src="/img/ajax-loader.gif" /></div>');

    ns.ajax.AjaxShim = function() {

        this.element = null;

        this.bindToContainer = function(container) {
            if ( this.element == null ) {
                this.element = SHIM_ELEMENT.clone();
            }

            var containerOffset = container.offset();

            this.element.css({
                left : containerOffset.left,
                top : containerOffset.top,
                width : container.width(),
                height : container.height()
            });

            $(document.body).append(this.element);
        };

        this.remove = function() {
            this.element.remove();
            this.element = null;
        };

    };

})();
